import cv2
import matplotlib.pyplot as plt
import numpy as np
from skimage.color import rgb2gray
from skimage.feature import canny
from skimage import measure

origCoins = cv2.imread('../visionBodyLearn/outputImages/resaved_temp0.png')
# origCoins = cv2.imread('../testData/images/faces/2.jpg')
coins = rgb2gray(origCoins)
edges = canny(coins)
edgePoints = np.where(edges == True)
x = edgePoints[0][18]
y = edgePoints[1][18]
op = origCoins[x, y]
fig, ax = plt.subplots(figsize=(4, 3))
ax.imshow(edges, cmap=plt.cm.gray)
ax.set_title('Canny detector')
ax.axis('off')
plt.show()

edgesImage = edges.astype(int)
label = measure.label(edgesImage, connectivity=2)
props = measure.regionprops(label)
pass